﻿#ifndef DATAINFO_H
#define DATAINFO_H

#include <QMainWindow>
#include <QSqlDatabase>
#include <QSqlError>
#include <QSqlDriver>
#include <QSqlRecord>
#include <QSqlQuery>
#include <QApplication>
#include <QDebug>
#include <QSqlTableModel>
#include <QListWidget>

namespace Ui {
class DataInfo;
}

class DataInfo : public QMainWindow
{
    Q_OBJECT

public:
    explicit DataInfo(QWidget *parent = nullptr);
    ~DataInfo();
    void setTableName(QString name){
        //初始化模型
        model = new QSqlTableModel();//默认数据库
        model->setTable(name);
    }
    void showTable();

private slots:
    void on_pushButton_clicked();

private:
    Ui::DataInfo *ui;
    QSqlTableModel *model;
};

#endif // DATAINFO_H
